package com.blueberry.commbank.domain.service.impl;

import com.blueberry.commbank.domain.entity.ExchangeRate;
import com.blueberry.commbank.domain.service.ExchangeRateService;
import java.math.BigDecimal;
import java.util.Currency;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ExchangeRateServiceImpl implements ExchangeRateService {
//    @Autowired
//    private YahooForexService yahooForexService;

    @Override
    public ExchangeRate getExchangeRate(Currency source, Currency target) {
        if (source.equals(target))
            return new ExchangeRate(source, target, BigDecimal.ONE);
        return new ExchangeRate(source, target, new BigDecimal("6.0"));
    }
}
